﻿using SuperSocket.ProtoBase;
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Text;

namespace SuperSocket.Client.HttpCode;

internal sealed class HttpBodyPipelineFilter : FixedSizePipelineFilter<HttpRequest>
{
    private readonly HttpRequest _currentRequest;

    public HttpBodyPipelineFilter(int size, HttpRequest request)
        : base(size)
    {
        _currentRequest = request;
    }

    protected override HttpRequest DecodePackage(ref ReadOnlySequence<byte> buffer)
    {
        _currentRequest.Body = buffer.CopySequence();

        return _currentRequest;
    }
}
